import React from 'react';
import {Component} from 'react';
import Table from 'uxcore-table';
import './XzxmDialog.less';

export default class XzxmDialog extends Component {

  constructor(props) {
    super(props);
  }

  handlePagerChange(current, pageSize) {
    const { onPageChange } = this.props;
    if (onPageChange) {
      onPageChange(current, pageSize);
    }
  }

  render() {
    const {
      data: {
        shzt,
        jsxdata,
        pageSize,
      }
    } = this.props;
    return (
      <div className="xzxm-dialog-content">
        <div className="xzxm-dialog-table">
          <Table
            height={640}
            showPager
            showHeaderBorder
            pageSize={pageSize}
            showPagerTotal
            showColumnPicker={false}
            className='kuma-uxtable-split-line'
            jsxcolumns={[
              {
                dataKey: 'coding', title: '复工编号', width: '120',
                render: (coding, item) => (item.shzt !== '办理完毕' ? '-' : coding)
              },
              {
                dataKey: 'shsj', title: '处理时间', width: '200',
                render: (shsj, item) => (!shsj ? '-' : shsj)
              },
              {
                dataKey: 'shzt', title: '办理状态', width: '150'
              },
              {
                dataKey: 'engname', title: '项目名称', width: '500'
              },
            ]}
            jsxdata={jsxdata}
            onPagerChange={(current, pageSize) => {this.handlePagerChange(current, pageSize)}}
          />
        </div>
      </div>
    );
  }
}
